package com.briup.smartlabs.common.utils;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

public class SmartLabsWebUtil {
	
	public static HttpServletRequest getRequest() {
		RequestAttributes ra = 
				RequestContextHolder.getRequestAttributes();
		if(ra instanceof ServletRequestAttributes) {
			ServletRequestAttributes sra = 
					(ServletRequestAttributes)ra;
			return sra.getRequest();
		}
		return null;
	}
}
